In the last video we created this great aggregation and visualization of the past performance of the
S&P 500 index and we actually calculated the average lucky returns over the respective periods.
However it might be more common that people ask let's assume I invested one hundred dollars in the S&P
500 index at the beginning of the year 2005.
What would be the value of this investment today.
So that's a maybe a bit more intuitive and we can change our returns triangle into a dollar triangle
by changing only one coding cell.
So here we are creating the dollar triangle and the steps are actually identical to the steps when creating
the true return triangle.
So I am just running the cells here
so until here the code is actually identical.
And then we are coming to the step where we are creating the 30 columns and that's the code for our
return triangle.
So we calculate it.
The rolling average lock return.
And this is here our new code and we've already learned this and the lecture on lock returns.
So we take you to the power off and then here and parenting is this that we have the amount of years.
My reply to buy the average lock returns for that period.
So let's have an example here and let's assume we are considering a four year period.
Then we have fear year to the power off and parenting is this four times the rolling average lock return.
And then finally we multiply this with the initial investment of 100.
So let's run near the sell and by doing so we are creating additional 30 columns for our annual data
frame.
And then again we create the triangle data frame by dropping the columns close and return.
So this year the triangle data frame with the dollar amounts.
And then finally we can make our plot.
So let's simply run here.
So that's the plot.
And also here it's a bit trickier to the time and we mean we max and center to get a meaningful result
and uh.
So a center of a 100 definitely makes sense.
So investing one hundred and getting my back 100 means uh 0 percent return.
So you don't win or lose anything.
And a final result of 60.
So you lost the 40 dollars.
That's a deep red.
And everything above 140 is the deep green here actually.
So let's have a look and the worst case here is actually investing at the beginning of the year 2000.
And finally at the end of the year 2002 we end up with an investment value of 60.
So we lost 40 dollars here.
But also here we can see that when we extend to the investment period it's uh getting more unlikely
that we lose money.
That's the that's the 13 year period from uh the beginning of 2008 and 2012 where we have fear and negative
returns.
So in that period we lost the three dollars.
So that's actually kind of the worst case.
But if we also consider here a 20 year period then historically we end up with 200 to 300 or even 400
tell us after 20 years.
And finally we can also see here that a one year period is quite risky and volatile.
So everything is possible here.
And with this we are finished.
And I hope to see also in the next video by.